package com.springboot.kaoqing.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.springboot.kaoqing.entity.Kecheng;
import com.springboot.kaoqing.entity.Qiandao;
import com.springboot.kaoqing.mapper.QiandaoMapper;
import com.springboot.kaoqing.qpage.QPage;
import com.springboot.kaoqing.service.IQiandaoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 签到记录表 服务实现类
 * </p>
 *
 * @author author
 * @since 2024-11-06
 */
@Service
public class QiandaoServiceImpl extends ServiceImpl<QiandaoMapper, Qiandao> implements IQiandaoService {

    @Override
    public IPage getPageList(QPage qPage, Qiandao obj) {
        QueryWrapper<Qiandao> queryWrapper=new QueryWrapper<>();
        if(obj.getKno()!=null&&!obj.getKno().equals("")){
            queryWrapper.like("kno",obj.getKno());
        }
        if(obj.getUid()!=null){
            queryWrapper.eq("uid",obj.getUid());
        }
        if(obj.getSid()!=null){
            queryWrapper.eq("sid",obj.getSid());
        }
        queryWrapper.orderByDesc("ctime");
        IPage<Qiandao> kechengIPage=this.page(new Page<>(qPage.getPage(), qPage.getRows()),queryWrapper);
        return kechengIPage;
    }



}
